<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>资源组管理</title>
    <%@include file="/WEB-INF/jsp/common/meta2.jsp" %>
</head>
<body class="content-body">
<div class="container-fluid">


    <table class="table table-responsive table-bordered">
        <tr>
            <th colspan="20" class="bg-info text-center">内容列表</th>
        </tr>
        <tr>
            <td colspan="20">
                <form id="listForm" action="${ctx}/common/resource/group/list" method="get" class="form-inline"
                      role="form">
                    <input type="hidden" name="pageNo" id="pageNo" value="${pageData.pagination.pageNo}"/>
                    <input type="hidden" name="pageSize" id="pageSize" value="10"/>
                    <input type="hidden" name="ascDesc" id="ascDesc" value="${pageData.ascDesc}"/>
                    <input type="hidden" name="orderName" id="orderName" value="${pageData.orderName}"/>

                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">类型：</div>
                            <select name="EQ_I&type" class="form-control input-sm">
                                <option value="0">-全部-</option>
                                <c:forEach items="${types}" var="type">
                                    <option value="${type.code}"  ${pageData.webMap['EQ_I&type'][0] == type.code ? 'selected':''}>${type.name}</option>
                                </c:forEach>
                            </select>

                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">资源组名称：</div>
                            <input type="text" name="LIKE_S&name" placeholder="资源组名称"
                                   class="input-sm form-control"
                                   value="${pageData.webMap['LIKE_S&name'][0]}">
                        </div>
                    </div>
                    <input type="button" onclick="search()" value="查询" class="btn btn-info btn-sm"/>

                    <a href="${ctx}/common/resource/group/new" class="btn btn-info pull-right btn-sm">添加资源组</a>
                </form>
            </td>
        </tr>
        <tbody>
        <tr class="bg-info">
            <th class="text-center">#</th>
            <th onclick="sort('name')">资源组名称</th>
            <th onclick="sort('enable')">禁用</th>
            <th onclick="sort('is_menu')">菜单项</th>
            <th onclick="sort('type')">类型</th>
            <th onclick="sort('order')">排序</th>
            <th  class="text-center">操作</th>
        </tr>
        <c:forEach items="${pageData.result}" var="entity" varStatus="i">
            <tr>
                <td class="text-center">
                        ${i.index + 1}
                </td>
                <td class="center">
                        ${entity.name}
                </td>
                <td class="center">
                        ${entity.enable ? '是':'否'}
                </td>
                <td class="center">
                        ${entity.isMenu?'是':'否'}
                </td>
                <td class="center">
                        ${entity.enumType.name}
                </td>
                <td class="center">
                        ${entity.order}
                </td>
                <td  class="text-center">
                    <a href="${ctx}/common/resource/group/edit/${entity.id}">编辑</a>
                    |
                    <a href="javascript:doDelete('${ctx}/common/resource/group/delete/${entity.id}');">删除</a>
                </td>
            </tr>
        </c:forEach>
        <c:if test="${fn:length(pageData.result) < 1}">
            <tr>
                <td colspan="20">无数据...</td>
            </tr>
        </c:if>
        </tbody>
    </table>


    <%@include file="/WEB-INF/jsp/common/pager.jsp" %>
</body>
</html>
<script>

    function doDelete(url) {
        if (confirm("确定执行该操作？")) {
            location.href = url;
        }
    }

</script>
